
void (*Device_PrintChar)( char c ) = 0;

void Device_PrintStr( const char *str )
{
	while(*str)
		Device_PrintChar( *str++ );	
}

void Device_PrintCRLF()
{
	Device_PrintStr("\n\r");
}

void PrintHex4( char c )
{
	char cc = c&0xf;
	if (cc>9)
		Device_PrintChar( 'A'-10 + cc );
    else
		Device_PrintChar( '0' + cc );
}

void PrintHex8( char c )
{
	PrintHex4( c >>4 );
	PrintHex4( c );
}

unsigned char CharToBCD( unsigned char c )
{
	char decenas = 0;
	while(c>=10)
	{
		decenas++;
		c -=10;
	}

	return (decenas<<4) | c;
}

void PrintHex16( unsigned int c )
{
	PrintHex8( c >>8 );
	PrintHex8( c & 0xff );
}
